<?php
namespace app\common\validate;

use think\Validate;

class ReimburseValidate extends Validate
{
    protected $rule =   [
        'id'                   => 'require|integer',
        'user_id|用户ID'       => 'require|integer',
        'page|页数'            => 'require|integer',
        'limit|条数'           => 'require|integer',
        'total|报销金额'       => 'require|gt:0',
        'explain|报销说明'     => 'require|length:1,500',
        'submit_time|提交时间' => 'require|date',
        'type|类型'            => 'require|integer',
    ];
    
    protected $scene = [
        /** 接口 */
        'show'      => ['user_id'],
        'add'       => ['user_id', 'total', 'explain', 'submit_time'],
        'list'      => ['user_id', 'page', 'limit', 'type'],

        /** 后台 */
        'list'       => ['page', 'limit'],
    ];
}